#ifndef LQSQLRELATIONALTABLEMODEL_H
#define LQSQLRELATIONALTABLEMODEL_H

#include <QSqlDatabase>
#include <QSqlRelationalTableModel>

class LQSqlRelationalTableModel : public QSqlRelationalTableModel
{
    Q_OBJECT

public:
    LQSqlRelationalTableModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
    ~LQSqlRelationalTableModel();

    QHash<int, QByteArray> roleNames() const {return role_names; }
    bool select();
    QVariant data(const QModelIndex &item, int role) const;

private:
    void generateRoleNames();
    QHash<int, QByteArray> role_names;
};

#endif // LQSQLRELATIONALTABLEMODEL_H